<?php

/**
 * This is the model class for table "t_rencana1".
 *
 * The followings are the available columns in table 't_rencana1':
 * @property string $KDDEPT
 * @property string $KDUNIT
 * @property string $KDSATKER
 * @property string $KDDEKON
 * @property string $JNSBEL
 * @property double $RENC01
 * @property double $RENC02
 * @property double $RENC03
 * @property double $RENC04
 * @property double $RENC05
 * @property double $RENC06
 * @property double $RENC07
 * @property double $RENC08
 * @property double $RENC09
 * @property double $RENC10
 * @property double $RENC11
 * @property double $RENC12
 * @property integer $ID
 */
class TRencana1 extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return TRencana1 the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 't_rencana1';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('RENC01, RENC02, RENC03, RENC04, RENC05, RENC06, RENC07, RENC08, RENC09, RENC10, RENC11, RENC12', 'numerical'),
			array('KDDEPT', 'length', 'max'=>3),
			array('KDUNIT, JNSBEL', 'length', 'max'=>2),
			array('KDSATKER', 'length', 'max'=>6),
			array('KDDEKON', 'length', 'max'=>1),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('KDDEPT, KDUNIT, KDSATKER, KDDEKON, JNSBEL, RENC01, RENC02, RENC03, RENC04, RENC05, RENC06, RENC07, RENC08, RENC09, RENC10, RENC11, RENC12, ID', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'KDDEPT' => 'Kddept',
			'KDUNIT' => 'Kdunit',
			'KDSATKER' => 'Kdsatker',
			'KDDEKON' => 'Kddekon',
			'JNSBEL' => 'Jnsbel',
			'RENC01' => 'Renc01',
			'RENC02' => 'Renc02',
			'RENC03' => 'Renc03',
			'RENC04' => 'Renc04',
			'RENC05' => 'Renc05',
			'RENC06' => 'Renc06',
			'RENC07' => 'Renc07',
			'RENC08' => 'Renc08',
			'RENC09' => 'Renc09',
			'RENC10' => 'Renc10',
			'RENC11' => 'Renc11',
			'RENC12' => 'Renc12',
			'ID' => 'ID',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('KDDEPT',$this->KDDEPT,true);
		$criteria->compare('KDUNIT',$this->KDUNIT,true);
		$criteria->compare('KDSATKER',$this->KDSATKER,true);
		$criteria->compare('KDDEKON',$this->KDDEKON,true);
		$criteria->compare('JNSBEL',$this->JNSBEL,true);
		$criteria->compare('RENC01',$this->RENC01);
		$criteria->compare('RENC02',$this->RENC02);
		$criteria->compare('RENC03',$this->RENC03);
		$criteria->compare('RENC04',$this->RENC04);
		$criteria->compare('RENC05',$this->RENC05);
		$criteria->compare('RENC06',$this->RENC06);
		$criteria->compare('RENC07',$this->RENC07);
		$criteria->compare('RENC08',$this->RENC08);
		$criteria->compare('RENC09',$this->RENC09);
		$criteria->compare('RENC10',$this->RENC10);
		$criteria->compare('RENC11',$this->RENC11);
		$criteria->compare('RENC12',$this->RENC12);
		$criteria->compare('ID',$this->ID);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}